package ecode

var (
	OK                    Ecode = Ecode{200, "OK"}
	FAIL                  Ecode = Ecode{400, "失败"}
	ERROR                 Ecode = Ecode{500, "错误"}
	ERROR_USER_EXIST      Ecode = Ecode{1001, "用户已存在"}
	ERROR_USER_NOT_EXIST  Ecode = Ecode{1002, "用户不存在"}
	ERROR_PASSWORD_WRONG  Ecode = Ecode{1003, "密码错误"}
	ERROR_USER_INVALID    Ecode = Ecode{1004, "用户信息无效"}
	ERROR_FORMAT          Ecode = Ecode{1005, "请求错误"}
	ERROR_TOKEN_NOT_EXIST Ecode = Ecode{1006, "请先登录"}
	ERROR_TOKEN_EXPIRED   Ecode = Ecode{1007, "请重新登录"}
)

type Ecode struct {
	Code int
	Msg  string
}

func (e Ecode) Error() string {
	return e.Msg
}
